<%-- 
    Document   : pertanyaan_tawaran_haji
    Created on : Aug 9, 2012, 9:31:25 AM
    Author     : ubuntu
--%>
<%@ include file="/WEB-INF/jsp/include/page_header.jspf" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Jawab Tawaran Haji</title>
        <script type="text/javascript">
            $(document).ready(function(){
                $('form').submit( function () {                    
                    return formValidation();                    
                });
                <%
                    if(request.getSession().getAttribute("ReturnMessages")!= null){  
                    request.getSession().removeAttribute("ReturnMessages");                                 
                %>
                    //parent.animateSaving(false);
                    parent.gridHResLoaded = false;
                    parent.loadGridHRes();
                    parent.dhxWins.window("plusW").close();
                <%
                    }
                %>
                <%   
                    String isEditMode = "false";                    
                    if(request.getAttribute("isEditMode")!= null){
                        isEditMode = (String)request.getAttribute("isEditMode");
                    } 
                    request.getSession().removeAttribute("isEditMode");                                     
                %>      
                        
            });   
             function tutup(){
                parent.dhxWins.window("plusW").close();
            }
             function validate1(f){
                if(document.getElementById("pertalian").value == ""){
                    alert("Sila pilih pertalian");
                    return false;                     
                }else{
                    f.action = "${pageContext.request.contextPath}/haji/response?saveEditAhliKumpulan";
                    f.submit();
                }
            }
            function validate2(f){
                if(document.getElementById("pertalian").value == ""){
                    alert("Sila pilih pertalian");
                    return false;                     
                }else{
                    f.action = "${pageContext.request.contextPath}/haji/response?submitTambahAhliKumpulan";
                    f.submit();
                }
            }
            
        </script>
    </head>
    <body>
        <s:messages/>
        <s:errors/> 
        <br/>        
        <s:useActionBean beanclass="th.stripes.util.ListUtil" id="listUtil" />
        <s:form beanclass="th.stripes.action.HajiResponseActionBean" id="fPopup" class="niceform">
            <s:hidden name="kumpulan.noAkaun" id="noAkaun"/>
            <s:hidden name="kumpulan.noPengenalan" id="noPengenalan"/>
            <s:hidden name="kumpulan.negeri" id="negeri"/>
            <s:hidden name="kumpulan.statushaji.kod" id="statusHaji"/>
            <s:hidden name="kumpulan.nama" id="nama"/>
            <s:hidden name="kumpulan.noAkaunPenambah" id="noAkaunPenambah"/>
            <s:hidden name="kumpulan.idMaklumatKeluarga" id="idMaklumatKeluarga"/>
            <s:hidden name="kumpulan.idMohonMaklumat" id="idMohonMaklumat"/>
         
            <div id="content" style="width:90%">
                <div id="logo">
                    <span>
                        <img src="${pageContext.request.contextPath}/images/img/ribbon.png"/>               
                    </span>
                </div>
                <h3>
                    Maklumat Ahli
                </h3>
                
                <p>
                    <label>No. Akaun TH :</label> ${actionBean.kumpulan.noAkaun}
                </p>
                <p>
                    <label>No. KP Semasa :</label> ${actionBean.kumpulan.noPengenalan}
                </p>
                <p>
                    <label>Nama :</label> ${actionBean.kumpulan.nama}
                </p>
                <p>
                    <label>Status Tawaran :</label> ${actionBean.kumpulan.statushaji.nama}
                </p>
                <p>
                    <label>Pertalian :</label>
                     <s:select name="kumpulan.hubungan.kod" id="pertalian">
                     <s:option value="">Sila Pilih</s:option>
                     <c:forEach items="${listHubungan}" var="item">
                            <s:option value="${item.kod}">${item.kod} - ${item.nama}</s:option>
                     </c:forEach>
                     </s:select> 
                  
                </p>                                               
                <p></p>                                                
                <p align="center">                    
                    <%
                    if(isEditMode.equals("true")){
                    %>
                    <s:button name="check" value="Simpan" class="button green" onclick="validate1(this.form)"/>
                    <s:button name="cls" value="Tutup" onclick="tutup()" class="button green"/>
                    <%
                    }else{
                    %>
                    <s:button name="check" value="Simpan" class="button green" onclick="validate2(this.form)"/>
                    <s:button name="cls" value="Tutup" onclick="tutup()" class="button green"/>
                    <%
                    }
                    %>
                </p>
            </div>
        </s:form>
    </body>
</html>
